package com.briup.day14.bean;

/**
 * @author ThinkBook
 */
public class Dog extends Animal {
    //忠诚度
    private int loyalValue;

    //构造方法
    public Dog() {
    }
    public Dog(String color, int age, int loyalValue) {
        super(color, age);
        this.loyalValue = loyalValue;
    }

    //重写toString
    @Override
    public String toString() {
        return "Dog{" +
                "color='" + super.getColor() + '\'' +
                ", age=" + this.getAge() +
                ", loyalValue=" + loyalValue +
                '}';
    }

    @Override
    public void eat() {
        System.out.println("我是狗狗，喜欢啃狗头...");
    }

    @Override
    public void sleep() {
        System.out.println("我是狗狗，看门需要趴着睡...");
    }
}
